#pragma once

#include <iostream>
#include <string>

namespace ns_log
{
  enum
  {
    INFO,
    DEBUG,
    WARNING,
    ERROR,
    FALSE
  };
  inline std::ostream &log(const std::string &level, const std::string &filename, int line)
  {
    std::string message;
    message += '[';
    message += level;
    message += ']';

    message += '[';
    message += filename;
    message += ']';

    message += '[';
    message += std::to_string(line);
    message += ']';

    std::cout << message; // 输入到缓冲区中

    return std::cout;
  }
#define LOG(level) log(#level, __FILE__, __LINE__)
}
